﻿<navigation:Page x:Class="SGTLightAccent.Views.Clientes" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:local="clr-namespace:SGTLightAccent.Controls"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
          
         
           xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
           xmlns:behaviors="clr-namespace:SGTLightAccent.Models"
           Title="Acceso para clientes"
		   xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" d:DesignHeight="895" d:DesignWidth="774" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           DataContext="{Binding Clientes, Source={StaticResource Locator}}"      >

    <StackPanel>
        <toolkit:Accordion HorizontalAlignment="Stretch" Height="600" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
            <toolkit:AccordionItem Header="Descarga en proceso"  HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <toolkit:Chart Title="{Binding Path=CargaSeleccionada.Barco.Nombre}" Height="Auto" Width="Auto" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
                    <toolkit:Chart.Series>
                        <toolkit:ColumnSeries ItemsSource="{Binding Path=Bodegas}" DependentValueBinding="{Binding Path=PesoActual}" IndependentValueBinding="{Binding Path=Numero}" Title="N° Bodega" />
                    </toolkit:Chart.Series>
                    <toolkit:Chart.Axes>
                        <toolkit:CategoryAxis Title="Bodegas" Orientation="X" FontStyle="Italic"/>
                        <toolkit:LinearAxis Title="Kilos restantes" Orientation="Y" Minimum="0" Maximum="{Binding Path=CargaSeleccionada.Peso}" Interval="Auto" ShowGridLines="True" FontStyle="Italic"/>
                    </toolkit:Chart.Axes>
                </toolkit:Chart>
            </toolkit:AccordionItem>
            <toolkit:AccordionItem HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Header="Datos">
                <Border BorderBrush="Silver" BorderThickness="1" Height="272" HorizontalAlignment="Center" Margin="0,0,0,0" x:Name="borderDescagas" VerticalAlignment="Top" Width="686"  >
                    <Grid Background="White" Margin="0,1,7,0" Height="262" VerticalAlignment="Top" HorizontalAlignment="Right" Width="712">
                        <sdk:Label Content="N° Carga" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,14,602,0" x:Name="labeld1" VerticalAlignment="Top" Width="62" />
                        <TextBox Height="28" HorizontalAlignment="Left" IsReadOnly="True" Margin="116,14,0,0" x:Name="textBoxd1" Text="{Binding CargaSeleccionada.Id, Mode=TwoWay}" VerticalAlignment="Top" Width="126" />
                        <sdk:Label Content="Barco" FontWeight="Bold" Height="28" HorizontalContentAlignment="Right" Margin="48,59,602,0" x:Name="label1" VerticalAlignment="Top" />
                        <TextBox Height="28" IsReadOnly="True" Margin="116,59,470,0" x:Name="textBox1" Text="{Binding CargaSeleccionada.Barco.Nombre, Mode=TwoWay}" VerticalAlignment="Top" />
                        <sdk:Label Content="Fecha comienzo" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,14,343,0" x:Name="label2" VerticalAlignment="Top" Width="109" />
                        <sdk:Label Content="Fecha final" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,61,343,0" x:Name="label3" VerticalAlignment="Top" Width="109" />
                        <sdk:Label Content="Peso Neto" FontWeight="Bold" Height="28" HorizontalContentAlignment="Right" Margin="302,107,343,0" x:Name="label4" VerticalAlignment="Top" />
                        <TextBox Height="28" HorizontalAlignment="Left" Margin="375,107,0,0" x:Name="textBox2" VerticalAlignment="Top" Width="126" Text="{Binding Mode=TwoWay, Path=CargaSeleccionada.PesoNetoTotal}" />
                        <sdk:Label Content="Peso ANP" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,107,602,0" x:Name="label5" VerticalAlignment="Top" Width="67" />
                        <TextBox Height="28" HorizontalAlignment="Left" Margin="116,107,0,0" x:Name="textBox3" Text="{Binding Mode=TwoWay, Path=CargaSeleccionada.PesoANPTotal}" VerticalAlignment="Top" Width="126" />
                        <sdk:DatePicker Height="28" Margin="375,14,211,0" x:Name="datePicker1" VerticalAlignment="Top" SelectedDate="{Binding CargaSeleccionada.Fecha_Ingreso, Mode=TwoWay}" SelectedDateFormat="Short" />
                        <sdk:DatePicker Height="28" Margin="375,0,211,173" x:Name="datePicker2" VerticalAlignment="Bottom" SelectedDate="{Binding CargaSeleccionada.Fecha_Salida, Mode=TwoWay}" />
                        <ProgressBar Margin="72,0,52,68" Height="28" VerticalAlignment="Bottom" Maximum="{Binding CargaSeleccionada.Peso}" Value="{Binding Mode=TwoWay, Path=CargaSeleccionada.PesoNetoTotal}" />
                        <sdk:Label Content="Carga esperada" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,16,19,0" x:Name="label4_Copy" VerticalAlignment="Top" Width="105" />
                        <sdk:Label Content="{Binding CargaSeleccionada.Peso}" Height="28" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="588,61,19,0" x:Name="label4_Copy1" VerticalAlignment="Top" Width="105" d:LayoutOverrides="VerticalAlignment" />
                        <sdk:Label Height="28" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Margin="53,0,0,68" x:Name="label4_Copy2" VerticalAlignment="Bottom" Width="15" Content="0%" FontSize="10.667" />
                        <sdk:Label Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Center" Margin="0,0,19,68" x:Name="label4_Copy3" VerticalAlignment="Bottom" Width="29" Content="100%" FontSize="10.667" />
                        <sdk:Label Height="20" HorizontalContentAlignment="Center" Margin="72,0,52,96" x:Name="label4_Copy4" VerticalAlignment="Bottom" Content="Progreso" FontSize="10.667" FontStyle="Italic" />
                    </Grid>
                </Border>


            </toolkit:AccordionItem>

            <toolkit:AccordionItem Header="Remitos"  HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
            	  <Grid>
                    <Grid.Resources>
                        <Style x:Key="customButtonStyle" TargetType="Button">
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="BorderThickness" Value="0"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="Button">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Grid.Resources>

                    <Button  x:Name="button1" Command="{Binding BotonImprimirRemitos}" HorizontalAlignment="Right" Height="40" VerticalAlignment="Top" Style="{StaticResource customButtonStyle}">
            	 	<Image Height="32" Source="/SGTLightAccent;component/Images/excel-doc.PNG" Stretch="UniformToFill" Width="32" />
                    </Button>
                     
            	 <sdk:DataGrid AutoGenerateColumns="False"  ItemsSource="{Binding RemitosPaginado}" x:Name="dataGrid2"  SelectionMode="Single" SelectedItem="{Binding RemitoSeleccionado, Mode=TwoWay}" Margin="0,39,0,0">
                        <sdk:DataGrid.Columns>
                        	<sdk:DataGridTextColumn Binding="{Binding Numero_Remito_Carga}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="N° Remito" Width="100" IsReadOnly="True" />
                        	<sdk:DataGridTextColumn Binding="{Binding Matricula_Camion}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="MAT" Width="80" IsReadOnly="True" />
                        	<sdk:DataGridTextColumn Binding="{Binding Hora_Salida}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Salida" Width="135*" IsReadOnly="True" />
                        	<sdk:DataGridTextColumn Binding="{Binding Hora_Llegada}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Llegada" Width="135*" IsReadOnly="True" />

                        	<sdk:DataGridTextColumn Binding="{Binding PesoNeto}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Peso Neto" Width="110" IsReadOnly="True"/>
                        	<sdk:DataGridTextColumn Binding="{Binding Deposito.Nombre, Mode=OneWay}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Deposito" Width="125" IsReadOnly="True" />
                        </sdk:DataGrid.Columns>
                       
                        

                    </sdk:DataGrid>
                    <toolkit:BusyIndicator x:Name="busyIndicator" IsBusy="{Binding EstaCargando}" DisplayAfter="0" BusyContent="Cargando remitos..." Margin="0,0,0,89"/>
                    <sdk:DataPager Height="26"  x:Name="dataPager1" PageSize="10" VerticalAlignment="Bottom" Source="{Binding RemitosPaginado}" DisplayMode="FirstLastPreviousNextNumeric" HorizontalContentAlignment="Right"  />
                    <!---->
					</Grid>
            	</toolkit:AccordionItem>
        </toolkit:Accordion>
       
        
    </StackPanel>

    
</navigation:Page>
